/* 基础样式 */
body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1, h2, h3 {
    color: #222;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

/* 搜索区域样式 */
.search-section {
    background-color: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.section-title {
    font-size: 20px;
    margin-bottom: 15px;
}

.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.ingredient-input {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.ingredient-input:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.add-button {
    background-color: #4CAF50;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 16px;
    transition: background-color 0.3s;
}

.add-button:hover {
    background-color: #45a049;
}

.selected-ingredients {
    min-height: 40px;
    margin-bottom: 20px;
}

.empty-state {
    color: #7e7e7e;
    font-style: italic;
}

.ingredient-tag {
    display: inline-block;
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 5px 10px;
    border-radius: 20px;
    margin-right: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.generate-button {
    width: 100%;
    background-color: #2196F3;
    color: rgb(255, 255, 255);
    padding: 14px 0;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.generate-button:hover {
    background-color: #0b7dda;
}

/* 食谱列表样式 */
.recipe-results {
    margin-bottom: 40px;
}

.recipe-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .recipe-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .recipe-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.recipe-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.recipe-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.recipe-content {
    padding: 15px 20px;
}

.recipe-title {
    font-size: 18px;
    margin-bottom: 10px;
}

.recipe-meta {
    display: flex;
    gap: 15px;
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.view-recipe {
    display: block;
    width: 100%;
    background-color: #4CAF50;
    color: white;
    text-align: center;
    padding: 10px 0;
    border-radius: 6px;
    font-size: 16px;
    transition: background-color 0.3s;
}

.view-recipe:hover {
    background-color: #45a049;
}

/* 食谱详情样式 */
.recipe-detail {
    background-color: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.loading-indicator {
    text-align: center;
    padding: 40px 0;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-radius: 50%;
    border-top: 4px solid #4CAF50;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none;
}

.recipe-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
}

.recipe-meta {
    margin-bottom: 30px;
}

.ingredients-list, .steps-list {
    margin-left: 20px;
}

.ingredients-list li, .steps-list li {
    margin-bottom: 10px;
}

.error-message {
    text-align: center;
    padding: 40px 0;
    color: #f44336;
}

.error-message .back-button {
    display: inline-block;
    background-color: #f44336;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    margin-top: 20px;
}
